package com.example.shop.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.CategoryEntity
import com.example.shop.R
import com.example.shop.utils.GlideUtils

class CategoryAdapter(list: MutableList<CategoryEntity>):BaseQuickAdapter<CategoryEntity,BaseViewHolder>(R.layout.item_category,list) {
    override fun convert(holder: BaseViewHolder, item: CategoryEntity) {
        holder.setText(R.id.category_tv,item.category_name)
        //Glide.with(context).load(item.category_icon).into(holder.getView(R.id.category_iv))
        GlideUtils.loadCircleImage(context,item.category_icon!!,holder.getView(R.id.category_iv))
    }
}